sugarglider

Maliny Po, S. Nathan Yang, H. Sherry Zhang, Dianne Cook

Software

Maliny Po, S. Nathan Yang, H. Sherry Zhang, Dianne Cook

ribbon: data visualization package for spatial-temporal data

🤔 What are glyph maps?

A concept purposed by Wickham et al. (2012). The main idea is to convert temporal coordinates into spatial ones, allowing a time series plot to be visualized on a map.

💪 Motivation

Glyph Maps enable the visualization of data across geographic regions and various time periods. The ribbon package enhances this capability by providing additional features with geom_glyph_ribbon().

How geom_glyph_ribbon() works

  • This function creates a ribbon geometry designed to display glyphs based on the combination of x_major and y_major. (Ex: longitude, Latitude)

  • For each x_minor value, the function displays a y interval defined by ymin_minor and ymax_minor.

💻 Demo

The National Oceanic and Atmosphere Administration (NOAA) provides weather data from stations all over the world. The aus_temp dataset contains daily temperature and precipitation levels recorded at various stations across Australia in the year 2020.

id long lat month tmin tmax prcp
ASN00001020 126.3867 -14.09 1 253.4516 319.0000 163.87097
ASN00001020 126.3867 -14.09 2 248.6786 322.6071 162.74074
ASN00001020 126.3867 -14.09 3 253.6129 333.1935 42.00000
ASN00001020 126.3867 -14.09 4 244.0357 340.9310 21.57143
ASN00001020 126.3867 -14.09 5 220.4138 331.9333 0.00000
a The data was retrieved using the rnoaa package.

💻 Demo

aus_temp |>
  ggplot(aes(x_major = long,
             y_major = lat, 
             x_minor = month,
             ymin_minor = tmin,
             ymax_minor = tmax)) +
  geom_sf(data = abs_ste,
          color = grey(0.7),
          fill = NA, inherit.aes = FALSE) +
  add_glyph_boxes() +      
  add_ref_lines() +         
  geom_glyph_ribbon() +     
  theme_map() +
  coord_sf(xlim = c(110, 155)) +
  labs(title = "Australian daily temperature, 2020")

More examples on Github

Q&A